package com.bst.etl.vo;

import com.bst.base.domain.BaseDb;
import com.bst.common.utils.StringUtils;

public class TableColumnsParamVO {
    private String qrySql;

    private String tableName;

    private String newTablePrefix; //新表前缀

    private Integer idDb;

    private BaseDb db;

    public String getNewTablePrefix() {
        return newTablePrefix;
    }

    public void setNewTablePrefix(String newTablePrefix) {
        this.newTablePrefix = newTablePrefix;
    }

    public String getQrySql() {
        String sql = (StringUtils.isEmpty(qrySql)?tableName:"("+qrySql+")");
        return  "select * from "+sql+" tt where 1=2";
    }

    public void setQrySql(String qrySql) {
        this.qrySql = qrySql;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Integer getIdDb() {
        return idDb;
    }

    public void setIdDb(Integer idDb) {
        this.idDb = idDb;
    }

    public BaseDb getDb() {
        return db;
    }

    public void setDb(BaseDb db) {
        this.db = db;
    }
}
